JavaScript

{dialog.object}setCSS Method

Syntax

id = {dialog.object}.setCSS(css [,id]);

Arguments

cssstring

A string containing CSS definitions.

idstring

An optional id (allowing you to update previously set CSS definitions.) If you do not pass in an id a new DOM 'style' node is created.

Returns

idstring

Returns the id of the node that was created. You can use this id to update the CSS.

Description

Adds CSS to the UX Component at run-time.

Discussion

The {dialog.object}.setCSS() method allows you to dynamically add CSS classes at run-time. The method returns the id of the node that was created for the CSS. This id can be used to update the CSS added to the component.

Example

var css = '.css1 {color:red;} .css2 {color:blue;}';

var id = {dialog.object}.setCSS(css);

//now update the definition
css = '.css1 {color:blue;}';

{dialog.object}.setCSS(css,id);